﻿package frEngine.shader.filters.fragmentFilters.extra
{
    import __AS3__.vec.*;
    import frEngine.shader.*;
    import frEngine.shader.filters.*;

    public class DeathGreyFilter extends FilterBase
    {
        public var deathConst:Vector.<Number>;

        public function DeathGreyFilter()
        {
            this.deathConst = this.Vector.<Number>([0.299, 0.587, 0.114, 0]);
            super(FilterType.DeathGrey, FilterPriority.DeathGreyFilter);
            return;
        }// end function

        override public function setRegisterParams(param1:Program3dRegisterInstance) : void
        {
            param1.getParamByName("{deathConst}", false).value = this.deathConst;
            return;
        }// end function

        override public function get programeId() : String
        {
            return "DeathGreyFilter0";
        }// end function

        override public function createFragmentColor(param1:Program3dRegisterInstance, param2:Boolean) : String
        {
            var _loc_3:String = "";
            var _loc_4:* = new Array();
            _loc_4.push(new ToBuilderInfo("fc0", "{deathConst}", false, 1, this.deathConst));
            _loc_3 = _loc_3 + "mul {output}.xyz, {output}.xyz, fc0.xyz \n";
            _loc_3 = _loc_3 + "dp3 ft0.x, {output}.xyz, {fcConst1}.zzz \n";
            _loc_3 = _loc_3 + "mov {output}.xyz, ft0.xxx\n";
            _loc_3 = param1.toBuild(_loc_3, _loc_4);
            return _loc_3;
        }// end function

    }
}
